<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
                <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
                <title></title>
                <link rel="stylesheet" href="__PUBLIC__/Css/bootstrap.min.css" />
                <link rel="stylesheet" href="__PUBLIC__/Css/common.css" />
                <jquery/>
                <script type="text/javascript" src="__PUBLIC__/Js/cate.js"></script>
        </head>
        <body>
                <form action='' method="post">
                        <div class="container-fluid">
                                <div class="row-fluid">
                                        <div class="span12">
                                                <table class="table table-bordered table-hover">
                                                        <thead>
                                                                <tr pid="0">
                                                                        <th>
                                                                                分类ID
                                                                        </th>
                                                                        <th>
                                                                                分类名称
                                                                        </th>
                                                                        <th>
                                                                                排序
                                                                        </th>
                                                                        <th>
                                                                                所属类型
                                                                        </th>
                                                                        <th>
                                                                                操作
                                                                        </th>
                                                                </tr>
                                                        </thead>
                                                        <tbody>
                                                                <foreach from='$data' value='$v'>
                                                                        <tr class="info" pid='{$v["pid"]}' cid="{$v['cid']}">
                                                                                <td>
                                                                                        <a href='javascript:;' class="plus"></a><a href='javascript:;' class="minus"></a>
                                                                                        {$v.cid}
                                                                                </td>
                                                                                <td class='open'>{$v._name}</td>
                                                                                </td>
                                                                                <td>
                                                                                        {$v.sort}
                                                                                </td>
                                                                                <td>
                                                                                        {$v.type_tid}
                                                                                </td>
                                                                                <td>
                                                                                        <a href="{|U:'add_son',array('pid'=>$v['cid'])}" class="btn btn-success"><i class="icon-edit icon-white"></i>添加子分类</a>
                                                                                        <a href="{|U:'edit',array('cid'=>$v['cid'])}" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
                                                                                        <a href="{|U:'del',array('cid'=>$v['cid'])}" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
                                                                                </td>
                                                                        </tr>
                                                                </foreach>
                                                                <tr pid="0">
                                                                        <td colspan='5' align='center'>
                                                                                <input type="hidden" name='table' value='category' />
                                                                                <form action='' method='post'>
                                                                                <input type="submit" value='排序' class="btn btn-primary"/>
                                                                                </form>
                                                                        </td>
                                                                </tr>
                                                        </tbody>
                                                </table>
                                        </div>
                                </div>
                        </div>
                </form>

                <script type="text/javascript">
                        $(function() {
                                $('.open').toggle(function() {
                                        var cid = $(this).attr('cid');
                                        $('tr[pid=' + cid + ']').fadeIn(600);
                                }, function() {
                                        var cid = $(this).attr('cid');
                                        $('tr[pid=' + cid + ']').fadeOut(600);
                                });
                        });
                </script>
        </body>
</html>